This invention relates to a photoelectric sensor using light pulses for detecting the presence or absence of a target object, its distance, its size and its characteristics. In particular, this invention relates to such a photoelectric sensor provided with means for preventing erroneous operations even in an environment where there are periodic noise pulses appearing at a timing which coincides with the timing for judging received light.
For detecting the presence or absence of an object, its distance and its characteristics in a non-contacting manner, it has been known to utilize photoelectric sensors using light pulses which are variously called a photoelectric sensor, a distance sensor or a displacement sensor. Photoelectric sensors using light pulses are generally composed of a light transmitter for transmitting light pulses to a target area and a light receiver for receiving light pulses coming from the target area. They may be broadly divided into the transmitting type and the reflecting type. With a photoelectric sensor of the transmitting type, the light pulses transmitted from the light transmitter fail to be received by the light receiver if it is interrupted by a target object for detection. In the case of a photoelectric sensor of the reflecting type, by contrast, the light pulses transmitted from the light transmitter is received by the light receiver by being reflected by a target object.
These sensors may be divided also into an integrated type having both its light transmitter and receiver contained in a common housing structure and a separated type having them contained in individual housing structures. The integrated type is advantageous in that the light transmitter and receiver can be more easily correlated or synchronized. Many of photoelectric sensors of the reflection type and those of the transmitting type having separated heads such as those using fiber optics are structured as an integrated type. Many of the sensors of the transmitting type with the non-separated type of heads are structured as a separated type.
Where a photoelectric sensor is installed, noise of different kinds such as light and electromagnetic waves is expected to be present in addition to light pulses emitted from the sensor itself. Because of the noise of these kinds in the environment, noise pulses appear in the output line passing through the capacitor connecting a converter such as a photoelectric converter element in the light receiver, mixed in either through the converter or through the power source line. Some of such noise pulses appear periodically, while some appear at random.
Many different methods have been developed for preventing erroneous operations of a light receiver caused by such noise pulses. One of the methods is based on the synchronization technology whereby the timing of light transmission from the light transmitter and that of light reception by the light receiver are synchronized. Another method is based on the identification of a pulse array. The sensor output will not be switched on unless more than a specified minimum number of pulses are detected continuously. Once the sensor output is switched on, it is not switched off unless more than another specified number of pulses are missed. Still another method is a combination of both of these technologies such that the synchronization technology is used in the first stage to eliminate the noise pulses not in accordance with the received light level and then the pulse array is identified in the later stage to eliminate noise pulses which happened to be in synchronism with the judgment timing, or the timing of light transmission.
Such prior art methods are effective against noise pulses which appear randomly in the reception signal. If the noise pulses appear periodically and if the timing of their appearance coincides with the judgment timing, or the timing of light transmission, they can hardly be effective. Examples of such a situation occur in factories and storehouses where fluorescent lamps inclusive of the general frequency types and inverter types are commonly used. Since the timing of light transmission from such sensors cannot be varied too widely in view of the level of response required of the sensor, there is also a limit within which the effects of noise pulses can be avoided by varying the timing of light transmission.
It is therefore an object of this invention in view of the situation described above to provide a photoelectric sensor using light pulses with which erroneous operations can be effectively avoided even where noise pulses appear periodically and at a timing that coincides with that of the transmission of light.
It is another object to develop basic technologies for such improved photoelectric sensors.
In one aspect, this invention relates to a method for controlling a photoelectric sensor which transmits pulsed light repetitively by driving a light transmitting element at a specified light transmission timing and compares with a specified threshold value the level of what is herein referred to as the reception signal which is an electrical signal obtained by processing light received by a light receiving element at a timing (referred to as the level judging timing) with a slight delay from the aforementioned light transmission timing. If an AC waveform corresponding to noise is included in the reception signal, the light transmission from the sensor is controlled such that a zero-cross timing of this AC waveform and the level-judging timing will coincide, and a sensor output is generated on the basis of the result of the aforementioned comparison.
In the above, the xe2x80x9cspecified threshold valuexe2x80x9d may be determined on the basis of known level of reception signals based on light emitted by the sensor itself. The xe2x80x9cslight delayxe2x80x9d for defining a timing in such a situation is a commonly known method of correlating (or synchronizing) light transmission and light detection. Thus, the invention does not require this slight delay to be non-zero, that is, the comparison with this threshold value may be initiated at the same timing as the beginning of light transmission.
xe2x80x9cNoisexe2x80x9d may be of different origins. Noise due to light mixed in through the light receiving element such as light from an inverter type fluorescent lamp, as well as electromagnetic wave noise mixed in through a power line, may be included. Thus, xe2x80x9cAC waveformxe2x80x9d, referred to above, includes not only sinusoidal waveforms with regularly changing signal levels but also various waveforms with output polarity changing frequently through an AC zero-level.
The zero-cross timing and the level-judging timing need not be matched exactly. Some degree of mismatching is allowed. The allowable range of mismatching may be determined, depending upon the level-judging timing such as the time during which the sampling gate is left open in the case of a sensor having a sampling gate, the output characteristics of the AC waveform corresponding to noise, and the threshold value for the judgment.
According to a method of this invention, the level of reception signal is judged at the zero-cross timing of the AC waveform corresponding to the noise (referred to as the xe2x80x9cnoise outputxe2x80x9d) or when the noise output has its minimum value even if the sensor is being used in an environment where an AC waveform corresponding to noise is likely to appear in the reception signal such as immediately below an inverter type fluorescent lamp. Thus, an erroneous operation, such as outputting a judgment of presence of light (transmitted from the sensor itself) although no light pulse transmitted from the sensor itself is being received, can be avoided according to this invention.
In the method embodying this invention, it is preferable to select a zero-cross timing at which the polarity of the AC waveform corresponding to noise is changing to become opposite the polarity of waveform of reception signal corresponding to pulsed light transmitted from the sensor itself. The xe2x80x9cpolarity of the waveform of reception signal corresponding to pulsed light from the sensor itselfxe2x80x9d may be the same as the polarity of the xe2x80x9cspecified thresholdxe2x80x9d for judging the level of the reception signal. This threshold value is usually selected on the side of the peak which appears on the waveform of the reception signal based on the pulse light transmitted from the sensor itself. If peaks appear on both sides due, for example, to the characteristics of the output circuit and threshold values with both polarities are set, one of the threshold values may be selected and its polarity may be defined as the xe2x80x9cpolarity of the reception signal waveformxe2x80x9d.
According to this preferred embodiment, in summary, the zero-cross timing is selected such that the AC waveform corresponding to noise is changing so as to have the opposite polarity to where the threshold value is set such that appearance of noise output in excess of the threshold value during the period of level-judgment (for example, while the sampling gate remains open) can be dependably avoided. This also makes it possible to set the period of level-judgment somewhat longer.
In another aspect, this invention relates to a photoelectric sensor characterized as comprising not only light transmitting means for transmitting pulsed light repetitively by driving a light transmitting element at a specified light transmission timing, light receiving means for receiving light and outputting an electrical reception signal corresponding to the received light, first level judging means for comparing the level of the reception signal with a specified first threshold value, thereby judging the level of the reception signal at a level-judging timing which is slightly delayed from the light transmission timing, and signal processor means for generating a sensor output based upon the result of a comparison by the first level judging means, but also second level judging means for comparing the level of the reception signal with a threshold value proximal to an AC zero level, thereby judging the level of the reception signal, and transmission timing control means for controlling the timing of next light transmission from the light transmitting means based upon the result of a comparison by the second level judging means. With such a photoelectric sensor, appearance of noise output measured by the threshold value near the AC zero can be detected by the second level judging means and the timing of light transmission can be controlled according to the condition of appearance of such noise output. Thus, the reception signal level can be judged when there is hardly any noise output or the noise output is near the AC zero level such that erroneous operations due to noise can be prevented. The second threshold is merely required to be xe2x80x9cproximalxe2x80x9d to an AC zero level. It naturally depends on the characteristics of the sensor how proximal the second threshold should be to an AC zero level but it should be clear to a person skilled in the art, since this threshold value is for the purpose of preventing erroneous operations due to noise, that this threshold value must at least be smaller than the threshold value of the first level judging means.
According to a first embodiment of the invention, the transmission timing control means delays the timing of next light transmission, after an official light transmission period has elapsed since the previous timing of light transmission, until the second level judging means determines that the level of the reception signal is close to the AC zero level. The xe2x80x9cofficial light transmission periodxe2x80x9d is a fixed period for the periodic transmission of pulse light from the light transmitting means. The interval between successive transmissions of light will change according to this embodiment, however, depending on the result of judgment by the second level judging means. The actual interval is the sum of the official light transmission period and the variable time required for the second level judging means to conclude that the reception signal level has come close to the zero level. According to the first embodiment of this invention, therefore, a minimum of the so-called official light transmitting period is maintained between successive light transmissions and each light pulse transmission takes place only when the level of the reception signal is determined to be near an AC zero level. Thus, the erroneous operations of the sensor can be prevented even more dependably.
The judgment that the level of the reception signal is close to an AC zero level may be made by the second level judging means by employing two threshold values near the AC zero level, one of them having positive polarity and the other having negative polarity. The judgment that the level of the reception signal is xe2x80x9cclosexe2x80x9d to an AC zero may be made only if the level of received signal is within a range sandwiched between these two threshold values.
According to a second embodiment of the invention, the transmission timing control means delays the timing of next light transmission, after an official light transmission period has elapsed since the previous timing of light transmission, until the second level judging means judges that the polarity of the level of the reception signal is changing in such a direction that it is becoming opposite to the polarity of a reception signal corresponding to a normal light pulse transmitted from the sensor itself. Such second level judging means may be structured so as to comprise a comparator for detecting the appearance of a reception signal exceeding a specified threshold value having the same polarity as the polarity of a normal reception signal corresponding to normal pulse light transmitted from the sensor itself and a xe2x80x9cback detector circuitxe2x80x9d for detecting the back end position of such an output signal outputted from the comparator when it is detecting the appearance of such a reception signal. Then, the transmission timing control means delays the timing of the next light transmission until the back end position of the output signal from the comparator is detected by the back detector circuit.
With a photoelectric sensor thus structured according to the second embodiment of the invention, transmission of pulsed light takes place on the condition that the level of the reception signal is determined to be changing in the direction such that its polarity is becoming the same as that of a normal reception signal corresponding to normal pulsed light from the sensor itself. Thus, the appearance of a noise output exceeding the threshold value near the AC zero during the period for judging the level of reception signal (such as while the sampling gate is left open) can be dependably avoided. In this manner, the period for judging the level of reception signal may be set somewhat longer. The transmission timing control means may preferably be so set as to generate a light transmission timing signal for the next light transmission immediately after a preset wait period after an official light transmission period has elapsed since the previous timing of light transmission, if the second level judging means does not judge that the polarity of the level of the reception signal is changing in the direction of becoming opposite to the polarity of a normal reception signal corresponding to normal light transmitted from the sensor itself. For this purpose, the transmission timing control means may include a timer which starts counting time selectively when an official light transmission period has passed or when a back end position of the output signal from the comparator is detected by the back detector circuit and generates a light transmission timing signal for the next light transmission when a specified period of time has elapsed. When such a light transmission timing signal is generated, the sensor transmits the next light pulse immediately.
There may be situations where the direction of change towards opposite polarity fails to be detected, for example, because of the disappearance of noise such that the delaying of the next light transmission is inadvertently continued. With a photoelectric sensor structured as described above, such a situation can be avoided because a minimum period of light transmission is assured.
According to a third embodiment of the invention, the transmission timing control means delays the timing of next light transmission, after an official light transmission period has elapsed since the previous timing of light transmission, until the second level judging means judges that the polarity of the level of the reception signal is changing in a direction of becoming the same as or opposite to the polarity of a normal reception signal corresponding to a normal light pulse transmitted from the sensor itself. Thus, unlike the second embodiment of the invention described above, light transmission takes place whether or not the polarity of the level of the reception signal is changing in the direction of becoming the same as that of a normal reception signal and hence light transmission can take place more quickly with a shorter wait period although errors due to noise can be avoided less dependably than by the second embodiment.
The second level judging means according to the third embodiment may be structured so as to comprise two (first and second) comparators respectively for detecting appearance of a reception signal exceeding a first or second threshold value having the same polarity as or opposite polarity to that of a normal reception signal corresponding to normal pulse light transmitted from the sensor itself and two (first and second) back detector circuits respectively for detecting the back end position of an output signal outputted from the first or second comparator in response to the appearance of a reception signal exceeding the first or second threshold. The transmission timing control means delays the timing of the next light transmission until the back end position of the output signal from either of the comparators is detected by corresponding one of the back detector circuits.
According to a fourth embodiment of the invention, the transmission timing control means is operable selectably in a first operating mode or a second operating mode. In the first operating mode, the transmission timing control means delays the timing of next light transmission, after an official light transmission period has elapsed since the previous timing of light transmission, until the second level judging means judges that the polarity of the level of the reception signal is changing in a direction of becoming opposite to the polarity of a normal reception signal corresponding to a normal light pulse transmitted from the sensor itself. In the second operating mode, the transmission timing control means causes light transmission immediately after an official light transmission period has elapsed since the previous timing of light transmission or thereafter by waiting for a specified length of time.
A photoelectric sensor thus structured according to the fourth embodiment of the invention is convenient because it can be operated in a suitable manner, depending on the environmental conditions in which it is installed. In the presence of a noise light with periodically varying brightness such as the light from an inverter type fluorescent lamp, the effect of the second embodiment can be obtained by operating in the first mode. Where there is another sensor in the vicinity and light transmitted from such a neighboring sensor may also be received although there is no periodically appearing noise present in the environment, such mutual interference can be avoided by selecting the second mode of operation.
Thus, it is preferable to provide a noise detector means for detecting noise light and electromagnetic noise waves of the type causing a reception signal which will vary periodically and have an AC waveform. With such noise detector means provided, the first mode may be selected if the presence of such periodically changing noise light or electromagnetic noise waves are detected. The second mode may be selected in the absence of such noise. The switching between the two modes of operation may be effected manually by means of a switch dedicated to this purpose.
One of the methods of judging the presence or absence of noise light and/or electromagnetic noise waves is to compare the level of reception signal with a specified threshold value. Another method is by determining whether or not the level of the reception signal remains nearly at an AC zero level over a specified length of time shorter than the official light transmitting time. These methods, however, are not intended to limit the scope of the invention.
A photoelectric sensor according to the fourth embodiment of the invention may comprise time measuring means for measuring time during which the level of a reception signal continuously remains nearly at an AC zero level for a specified length of time shorter than the official light transmitting period and mode switching means for switching to the second mode if the time measured by the time measuring means exceeds the specified length of time and to the first mode if the time measured by the time measuring means is shorter than the specified length of time. With a sensor thus structured, the operating modes can be switched, depending on the presence or absence of noise light or electromagnetic noise waves.
A photoelectric sensor as described above may be formed by using a semiconductor integrated circuit. Such a semiconductor integrated circuit according to this invention may be characterized as comprising a first external terminal for supplying power, a second external terminal for outputting a transmission controlling signal for a driver circuit for the light transmitting element of the sensor, a third external terminal for outputting a sensor load controlling signal for a driver circuit for sensor load, a power source circuit for receiving power through the first external terminal and providing a stabilized power source for internal circuits of the integrated circuit, a light receiving circuit for outputting a reception signal according to light received by the light receiving element of the sensor, a light transmitting circuit for outputting the transmission controlling signal to the second external terminal, an output circuit for outputting the sensor load controlling signal to the third external terminal and a signal processor circuit for controlling the output circuit and the light transmitting circuit by the reception signal received from the light receiving circuit. The light receiving circuit, the light transmitting circuit, the output circuit and the signal processor circuit are integrated, and the signal processor circuit comprises a first level judging means for comparing the reception signal with a specified threshold value at a timing slightly delayed from the timing of light transmission from the light transmitting element, a signal processing means for generating a sensor output according to a result of comparison by the first level judging means and supplying the sensor output to the output circuit, a second level judging means for comparing the reception signal with another threshold value near an AC zero level, and a light transmission timing controlling means for supplying to said light transmitting circuit a light transmission timing control signal for controlling the timing of next light transmission from the light transmitting element according to the comparison by the second level judging means.
In the above, xe2x80x9csensor loadxe2x80x9d includes various devices which are electrically connected to the sensor and controlled on the basis of outputs from the sensor. Examples of the sensor load include input units of a programmable logic controller. Examples of their driving circuit include switching transistors and triacs. By using such a semiconductor integrated circuit, the sensor as a whole can be made smaller and the production cost can be reduced.
With an integrated circuit as described above, too, various functions as described above can be provided. For example, the light transmission timing controlling means may delay the timing of the next light transmission until the level of the reception signal according to the second level judging means becomes close to an AC zero level after an official light transmitting period. The light transmission timing controlling means may delay the timing of the next light transmission until the level of the reception signal is determined by the second level judging means to be changing in the direction of having the opposite polarity to that of a normal reception signal corresponding to a normal pulse transmitted from the light transmitting element. The light transmission timing controlling means may cause the next light transmission from the light transmitting element immediately after waiting for a specified length of time since the previous transmission of light from the light transmitting element.
The signal processor circuit may be made selectably operable in a first mode and a second mode where the first mode is wherein the timing of the next light transmission is delayed until it is determined by the second level judging means that the level of the reception signal is changing in a direction of having the opposite polarity to that of a normal reception signal corresponding to a normal pulse transmitted from the light transmitting element, and the second mode is wherein the next light transmission is caused immediately after a specified length of time since the previous transmission of light from the light transmitting element. A noise detecting means may be further provided for detecting the presence or absence of periodically changing noise light or electromagnetic noise waves having an AC waveform and selecting the first or second mode accordingly. The judgment of such presence or absence may be effected by comparing the reception signal level with a specified threshold or by checking whether the reception signal level remains nearly equal to an AC zero level over a specified length of time.